The code behind the control for the MDITaskBar ActiveX Control by Maxx Zephyr Technology.
-----------------------------------------------------------------------------------------

The way i created the control was simple.  First, i needed a picture box to put on the MDI form.  Why?  The picture box is great when you need to draw something on an MDI that doesn't support alignment.  The picture box does.  Next, i needed a control that holds buttons and that can easily delete and add buttons at run-time.  So i drew a toolbar on the picture box.  Finally, i needed a way to add buttons and delete buttons at run time, so i created a .bas module that contained such procedures and methods.  Then i needed to know when to add buttons and when to delete buttons, and finally when to set buttons active.  Thus i discovered the best way is to add a button when a form loads, delete a button when a form unloads, and to set a button to active when a form activates (makes sense don't it?).  This all worked great and i got everything to work just fine.  Then it occured to me that i could make it better - make it an ActiveX control!

So when i embarked on making it an ActiveX control i used the same methods and the same controls and code.

To use the MDITaskBar ActiveX control by Maxx Zephyr Technology, you need to...

NOTE: This new version has an internal ImageList control that adds images directly from the form's icon - making it even easier to implement!

I. Download the zip file...which i imagine you did if you see this
II. Unzip the file to a new folder, such as a folder within the VB directories
III. Register the control
     A. Move all of the MDITaskBarControl.* files to c:\windows\system
        1. This includes .oca, .dep, .exp, .lib, and .ocx
     B. Click the start button
     C. Hit Run...
     D. Type this line: regsvr32.exe "[Path to Ocx]\MDITaskBarControl.ocx"
     E. Click OK
     F. You will get a message indicating the registration was successful
        1. Now the control will be seen by Visual Basic
IV. Have an application with an MDIForm in it
    A. Add the MDITaskBar ActiveX Control to your toolbox
    B. Draw the control onto the MDIForm
V. Add forms to the MDITaskBar ActiveX Control at run-time
   A. In the form's load event, add the command: MDIForm1.MDITaskBar1.AddFormToTaskBar Me, Me.Name
      1. Remember you can use any property of the form or actually anything, but the form Tag property will be assumed if you leave the optional Key parameter of this command off
      2. With the new implementation, the icon of the form is automatically added to the control's internal imagelist and accessed automatically by the form name!
VI. Set the form button to be active on the MDITaskBar ActiveX Control
   A. In the form's Activate event, add the command: MDIForm1.MDITaskBar1.SetActiveFormOnTaskBar Me, Me.Name
      1. See above about using the form's Name property
VII. Remove forms from the MDITaskBar ActiveX Control
   A. In the form's Query_Unload evnet, add the command: MDIForm1.MDITaskBar1.RemoveFormFromTaskBar Me, Me.Name
      1. See above about using the form's Name property

And that's it...visibility and form button click methods are handled inside the control's code.	